import request from '../utils/request'

export const getTables = () => {
  return request({
    url: '/examples/findTables',
    method: 'GET'
  })
}
export const insertTables = (data) => {
  return request({
    url: '/examples/insertTables',
    method: 'POST',
    data
  })
}
export const deleteTable = (data) => {
  return request({
    url: '/examples/deleteTable',
    method: 'POST',
    data
  })
}

//获取部门人员
export const getDepartmentPersonnel = () => {
  return request({
    url: '/examples/getDepartmentPersonnel',
    method: 'GET'
  })
}

export const postWorkflowTemplate = (data) => {
  return request({
    url: '/examples/postWorkflowTemplate',
    method: 'POST',
    data
  })
}

export const getWorkflowTemplates = () => {
  return request({
    url: '/examples/getWorkflowTemplates',
    method: 'GET'
  })
}
export const getWorkflowTemplateOne = (data) => {
  return request({
    url: `/examples/getWorkflowTemplateOne?${new URLSearchParams(data)}`,
    method: 'GET'
  })
}
export const updateWorkflowTemplate = (data) => {
  return request({
    url: '/examples/updateWorkflowTemplate',
    method: 'POST',
    data
  })
}
export const deleteWorkflowTemplate = (data) => {
  return request({
    url: '/examples/deleteWorkflowTemplate',
    method: 'POST',
    data
  })
}

export const postWorkflowData = (data) => {
  return request({
    url: '/examples/postWorkflowData',
    method: 'POST',
    data
  })
}

export const getWorkflowDatasBySubmit = (data) => {
  return request({
    url: `/examples/getWorkflowDatasBySubmit?${new URLSearchParams(data)}`,
    method: 'GET'
  })
}

export const getWorkflowDatasByExamine = (data) => {
  return request({
    url: `/examples/getWorkflowDatasByExamine?${new URLSearchParams(data)}`,
    method: 'GET'
  })
}

export const workflowExamine = (data) => {
  return request({
    url: '/examples/workflowExamine',
    method: 'POST',
    data
  })
}
